//
//  UINavigationController+HideBottomBar_m.m
//  HengYouCai
//
//  Created by ycgwl on 2017/4/26.
//  Copyright © 2017年 lwj. All rights reserved.
//

#import "UINavigationController+HideBottomBar_m.h"
#import "BannerWebViewVC.h"
#import "RiskAlertView.h"
@implementation UINavigationController (HideBottomBar_m)

- (void)pushViewController:(nonnull UIViewController *)viewController animated:(BOOL)animated withHideBottomBarWhenPush:(BOOL)isHide pop:(BOOL)isHide1{
    
    
    viewController.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
//    viewController.hidesBottomBarWhenPushed = isHide;
//    [self pushViewController:viewController animated:animated];
//    viewController.hidesBottomBarWhenPushed = isHide1;

    UIViewController *vc = self.topViewController;
    
    vc.hidesBottomBarWhenPushed = isHide;
    [self pushViewController:viewController animated:animated];
    vc.hidesBottomBarWhenPushed = isHide1;
}
- (void)pushViewControllerWithUrlStr:(NSString *_Nullable)urlStr navTitle:(NSString *_Nullable)title withHideBottomBarWhenPush:(BOOL)isHide pop:(BOOL)popHide
{
    UIViewController *vc = self.topViewController;
    vc.hidesBottomBarWhenPushed = isHide;
    [self pushViewController:[[BannerWebViewVC alloc] initWithUrlStr:urlStr title:title] animated:YES];
    vc.hidesBottomBarWhenPushed = popHide;
}
//- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item
//{
//   
//    UIViewController* vc = [self topViewController];
//    
//    if ([vc isKindOfClass:[RiskAppraisalVC class]]) {
//        [[NSNotificationCenter defaultCenter] postNotificationName:@"postName" object:nil];
//
//        vc.navigationItem.title = @"风险测评";
//        return NO;
//    }else{
//        [vc.navigationController popViewControllerAnimated:YES];
//        return YES;
//    }
//    
//}
@end
